package ${packageName}.domain.po;

import lombok.Data;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
import java.math.BigDecimal;

/**
 * @author honglei
 * @version 1.0
 * @time: ${.now}
 * @Description PO对象 ${comments}
 */
@Data
@TableName(value = "${tableName}")
public class ${poName} implements Serializable {


<#if columnBeanList?exists>
    <#list columnBeanList as model>
        /*
        *  ${model.comments!}
        */
        <#if (model.columnType = 'varchar' || model.columnType = 'VARCHAR'
        ||model.columnType = 'char'||model.columnType = 'CHAR'
        ||model.columnType = 'nchar'
        ||model.columnType = 'uniqueidentifier'
        ||model.columnType = 'varchar2'||model.columnType = 'nvarchar2'
        ||model.columnType = 'text'||model.columnType = 'TEXT'
        ||model.columnType = 'tinytext'||model.columnType = 'TINYTEXT'
        ||model.columnType = 'mediumtext'||model.columnType = 'MEDIUMTEXT'
        ||model.columnType = 'longtext'||model.columnType = 'LONGTEXT'
        ||model.columnType = 'nvarchar'||model.columnType = 'NVARCHAR' )>

        @TableField(value = "${model.columnName}")
        private String ${model.attrname};

        <#elseif (model.columnType = 'INT'|| model.columnType = 'int'
        ||model.columnType = 'INTEGER'|| model.columnType = 'integer'
        ||model.columnType = 'TINYINT'||model.columnType = 'tinyint'
        ||model.columnType = 'SMALLINT'||model.columnType = 'smallint'
        ||model.columnType = 'BIT'||model.columnType = 'bit')>
        @TableField(value = "${model.columnName}")
        private Integer ${model.attrname};

        <#elseif (model.columnType = 'timestamp'|| model.columnType = 'TIMESTAMP'
        ||model.columnType = 'datetime'||model.columnType = 'DATETIME'
        ||model.columnType = 'date'||model.columnType = 'DATE')>
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
        @TableField(value = "${model.columnName}")
        private Date ${model.attrname};

        <#elseif (model.columnType = 'bigint'|| model.columnType = 'BIGINT')>
        @TableField(value = "${model.columnName}")
      //  private Long ${model.attrname};
        private String  ${model.attrname};

        <#elseif (model.columnType = 'float'|| model.columnType = 'binary_float'
        ||model.columnType = 'double'|| model.columnType = 'binary_double'
        ||model.columnType = 'number'
        )>
        @TableField(value = "${model.columnName}")
        private Double ${model.attrname};

        <#elseif (model.columnType = 'decimal'|| model.columnType = 'DECIMAL')>
        @TableField(value = "${model.columnName}")
        private BigDecimal ${model.attrname};

        <#else >
        @TableField(value = "${model.columnName}")
        private String ${model.attrname};
        </#if>
    </#list>
</#if>
}
